cmake_minimum_required(VERSION 3.19)
project(gtest_demo)

message("cmake module " $ENV{CMAKE_MODULE_PATH})
message("project dir "  ${PROJECT_SOURCE_DIR})

set(CMAKE_BUILD_TYPE DEBUG)

set(CMAKE_CXX_FLAGS "/OPT:NOREF /std:c++14 /EHsc  /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "")


string(REGEX REPLACE "(.*)/(.*)/(.*)" "\\1" PARENTPATH  ${PROJECT_SOURCE_DIR})
message("last=" ${PARENTPATH})

include(${PARENTPATH}/CmakeTemplate.txt)
include_directories(./third/gtest/include)
link_directories(./third/gtest/lib)

link_libraries(gtestd.lib gtest_maind.lib gmockd.lib gmock_maind.lib)

# include(${CMAKE_CURRENT_SOURCE_DIR}/../CmakeTemplate.txt)

add_executable(gtest_demo gtest_demo.cpp)

set_property(TARGET gtest_demo PROPERTY
  MSVC_RUNTIME_LIBRARY MultiThreadedDebugDLL)

  target_include_directories(gtest_demo SYSTEM  PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../obj/inc/third/include)
